<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;

class LogisticsController extends Controller
{
    public function inquire(Request $request){
        $c_account=$request['c_account'];

        if($c_account!=null){
            $objct=DB::table('orders')->select('tracking_number')->where('c_account',$c_account)->first();
            $nu= $objct -> tracking_number;
        }else{
            $nu=$request['tracking_number'];
        }
        $com="shentong";
        $context="查询";
        return "<script>location.href='https://www.kuaidi100.com/chaxun?com=".$com."&nu=".$nu."'</script>>";
        //return "<a href='https://www.kuaidi100.com/chaxun?com=".$com."&nu=".$nu."'>".$context."</a >";
    }
}
